
import axiosInstance, { AxiosResponseProps } from '@/api/request';

// 通过授权code获取accessToken和openid
export const wxAccessToken = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/public/wxAccessToken', { params: params || {}, headers: headers });
};

// 通过授权code获取accessToken和openid
export const alipayAccessToken = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/public/getAliPayUserInfo', { params: params || {}, headers: headers });
};

// 通过报名ID获取token
export const tokenInfo = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/public/getToken', { params: params || {}, headers: headers });
};

// 通过报名ID获取商户信息
export const merchantInfo = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/activityRegister/merchant/info', { params: params || {}, headers: headers });
};

// 通过报名ID获取商户信息
export const payCreate = (params?: any, headers?: any) => {
	return axiosInstance.post('/api/wealthy/app/order/payCreate', params || {}, { headers: headers });
};

// 通过订单ID获取支付结果信息
export const payResult = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/order/orderInfo', { params: params || {}, headers: headers });
};

// 通过订单ID获取支付状态（快速轮询接口）
export const orderStatus = (params?: any, headers?: any) => {
	return axiosInstance.get('/api/wealthy/app/order/orderStatusResult', { params: params || {}, headers: headers });
};